//
//  SYP_MusicListTableCell.m
//  wind
//
//  Created by SYP on 16/1/12.
//  Copyright © 2016年 李金明. All rights reserved.
//

#import "SYP_MusicListTableCell.h"
#import "Masonry.h"
#define PLACE (15) // 序号距左的距离
#define PLACES (10) // 序号距离右距离
#define NUMSIZE (15) // 序号的大小
#define NUMHEIGHT (30) // 序号的宽度
#define TOP (10) // 距离上下的距离
#define MUSICSIZE (200) // 歌名歌手名的宽度
#define MUSICHEIGHT (15) // 歌手歌名的高度


@implementation SYP_MusicListTableCell

- (void)dealloc
{
    [_musicName release];
    [_singerName release];
    [_numLabel release];
    [super dealloc];
}

- (void)creatSubviews
{
    [self creatViews];
}

- (void)creatViews
{
    // 歌曲序号
    self.numLabel = [UILabel new];
    self.numLabel.textColor = [UIColor colorWithWhite:0.813 alpha:1.000];
    self.numLabel.text = @"1";
    self.numLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.numLabel];
    [_numLabel release];
    
    
    // 歌曲名称
    self.musicName = [UILabel new];
    self.musicName.text = @"暂无歌曲";
    self.musicName.textColor = [UIColor whiteColor];
    self.musicName.font = [UIFont systemFontOfSize:14 * SCREEN_ONE];
    [self.contentView addSubview:self.musicName];
    [_musicName release];
    
    // 歌手名
    self.singerName = [UILabel new];
    self.singerName.textColor = [UIColor lightGrayColor];
    self.singerName.text = @"暂无";
    self.singerName.font = [UIFont systemFontOfSize:13 *SCREEN_ONE];
    [self.contentView addSubview:self.singerName];
    [_singerName release];
    

}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.equalTo(self.contentView);
        make.left.mas_equalTo(PLACE);
        make.right.equalTo(self.singerName.mas_left).with.offset(-PLACES);
        make.height.mas_equalTo(NUMSIZE);
        make.width.mas_equalTo(NUMHEIGHT);
        
    }];
    
    [self.musicName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        
        make.top.equalTo(self.contentView).with.offset(TOP);
        make.left.equalTo(self.numLabel.mas_right).with.offset(PLACES);
        make.width.mas_equalTo(MUSICSIZE);
        make.height.mas_equalTo(MUSICHEIGHT);
    }];
    
    [self.singerName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.equalTo(self.contentView).with.offset(-TOP);
        make.left.equalTo(self.numLabel.mas_right).with.offset(PLACE);
        make.width.mas_equalTo(MUSICSIZE);
        make.height.mas_equalTo(MUSICHEIGHT / 1.3);
        
    }];
    
    
    
}




@end
